// 引入三方到Storybook
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
// 坑：tailwindcss的样式先于element-plus，否则element-plus的el-button样式将受到影响
import '@/tailwindcss/input.css';
import 'element-plus/dist/index.css';
import '@/iconfont/iconfont.css';

import Vant from 'vant'
import 'vant/lib/index.css'

import 'v3-easyui/dist/themes/default/easyui.css';
import 'v3-easyui/dist/themes/icon.css';
import 'v3-easyui/dist/themes/vue.css';
import EasyUI from 'v3-easyui';

import {setup} from '@storybook/vue3';

setup(app => {
  app.use(ElementPlus, {size: 'small', locale: zhCn});
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }
  app.use(Vant)
  app.use(EasyUI)
});

/** @type { import('@storybook/vue3').Preview } */
const preview = {
  parameters: {
    actions: {argTypesRegex: '^on[A-Z].*'},
    backgrounds: {
      default: 'light'
    },
    layout: 'centered',
    options: {
      storySort: {
        order: [
          'ark-component-v2', ['ArkIconFont', 'ArkTooltip', 'ArkScroll', 'ArkForm', 'ArkFilterForm', 'ArkDialog', 'ArkDialogForm', 'ArkTable', 'ArkPagination', 'ArkPaginationTable', 'ArkActionBar', 'ArkSideTree', 'ArkCompositeTable'],
          'ark-component-v1', ['ArkIconFont', 'ArkTooltip', 'ArkForm', 'ArkDialogForm', 'ArkTable', 'ArkUpload'],
          'base-component-v1', ['ArkCard', 'ArkSwiper', 'ArkScroll', 'ArkDesensitized', 'ArkChart', 'ArkSvgMap', 'ArkDotStatus', 'ArkAvatar', 'ArkStatisticVisual', 'ArkJsonEditor', 'ArkBlankAdaptive',],
          '仁济会诊', ['分页查询', '信息卡片', '会诊详情'],
          '西安集贤', ['面板', '对话框'],
          '校园物联', ['页眉', '统计', '描述', '描述项'],
          '轮播', ['操作Scroll', '操作DOM'],
          '监控', ['大华-单独手动播放', '大华-分组自动播放'],
        ]
      }
    }
  },
};

export default preview;
